// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

/// A dyn-compatible, crate-private version of [super::TopicAdmin].
#[async_trait::async_trait]
pub trait TopicAdmin: std::fmt::Debug + Send + Sync {
    async fn create_topic(
        &self,
        req: crate::model::Topic,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Topic>>;

    async fn update_topic(
        &self,
        req: crate::model::UpdateTopicRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Topic>>;

    async fn get_topic(
        &self,
        req: crate::model::GetTopicRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Topic>>;

    async fn list_topics(
        &self,
        req: crate::model::ListTopicsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListTopicsResponse>>;

    async fn list_topic_subscriptions(
        &self,
        req: crate::model::ListTopicSubscriptionsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListTopicSubscriptionsResponse>>;

    async fn list_topic_snapshots(
        &self,
        req: crate::model::ListTopicSnapshotsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListTopicSnapshotsResponse>>;

    async fn delete_topic(
        &self,
        req: crate::model::DeleteTopicRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>>;

    async fn detach_subscription(
        &self,
        req: crate::model::DetachSubscriptionRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::DetachSubscriptionResponse>>;
}

/// All implementations of [super::TopicAdmin] also implement [TopicAdmin].
#[async_trait::async_trait]
impl<T: super::TopicAdmin> TopicAdmin for T {
    /// Forwards the call to the implementation provided by `T`.
    async fn create_topic(
        &self,
        req: crate::model::Topic,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Topic>> {
        T::create_topic(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn update_topic(
        &self,
        req: crate::model::UpdateTopicRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Topic>> {
        T::update_topic(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_topic(
        &self,
        req: crate::model::GetTopicRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Topic>> {
        T::get_topic(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_topics(
        &self,
        req: crate::model::ListTopicsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListTopicsResponse>> {
        T::list_topics(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_topic_subscriptions(
        &self,
        req: crate::model::ListTopicSubscriptionsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListTopicSubscriptionsResponse>> {
        T::list_topic_subscriptions(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_topic_snapshots(
        &self,
        req: crate::model::ListTopicSnapshotsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListTopicSnapshotsResponse>> {
        T::list_topic_snapshots(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn delete_topic(
        &self,
        req: crate::model::DeleteTopicRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>> {
        T::delete_topic(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn detach_subscription(
        &self,
        req: crate::model::DetachSubscriptionRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::DetachSubscriptionResponse>> {
        T::detach_subscription(self, req, options).await
    }
}

/// A dyn-compatible, crate-private version of [super::SubscriptionAdmin].
#[async_trait::async_trait]
pub trait SubscriptionAdmin: std::fmt::Debug + Send + Sync {
    async fn create_subscription(
        &self,
        req: crate::model::Subscription,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Subscription>>;

    async fn get_subscription(
        &self,
        req: crate::model::GetSubscriptionRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Subscription>>;

    async fn update_subscription(
        &self,
        req: crate::model::UpdateSubscriptionRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Subscription>>;

    async fn list_subscriptions(
        &self,
        req: crate::model::ListSubscriptionsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListSubscriptionsResponse>>;

    async fn delete_subscription(
        &self,
        req: crate::model::DeleteSubscriptionRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>>;

    async fn modify_push_config(
        &self,
        req: crate::model::ModifyPushConfigRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>>;

    async fn get_snapshot(
        &self,
        req: crate::model::GetSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Snapshot>>;

    async fn list_snapshots(
        &self,
        req: crate::model::ListSnapshotsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListSnapshotsResponse>>;

    async fn create_snapshot(
        &self,
        req: crate::model::CreateSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Snapshot>>;

    async fn update_snapshot(
        &self,
        req: crate::model::UpdateSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Snapshot>>;

    async fn delete_snapshot(
        &self,
        req: crate::model::DeleteSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>>;

    async fn seek(
        &self,
        req: crate::model::SeekRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::SeekResponse>>;
}

/// All implementations of [super::SubscriptionAdmin] also implement [SubscriptionAdmin].
#[async_trait::async_trait]
impl<T: super::SubscriptionAdmin> SubscriptionAdmin for T {
    /// Forwards the call to the implementation provided by `T`.
    async fn create_subscription(
        &self,
        req: crate::model::Subscription,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Subscription>> {
        T::create_subscription(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_subscription(
        &self,
        req: crate::model::GetSubscriptionRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Subscription>> {
        T::get_subscription(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn update_subscription(
        &self,
        req: crate::model::UpdateSubscriptionRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Subscription>> {
        T::update_subscription(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_subscriptions(
        &self,
        req: crate::model::ListSubscriptionsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListSubscriptionsResponse>> {
        T::list_subscriptions(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn delete_subscription(
        &self,
        req: crate::model::DeleteSubscriptionRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>> {
        T::delete_subscription(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn modify_push_config(
        &self,
        req: crate::model::ModifyPushConfigRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>> {
        T::modify_push_config(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_snapshot(
        &self,
        req: crate::model::GetSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Snapshot>> {
        T::get_snapshot(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_snapshots(
        &self,
        req: crate::model::ListSnapshotsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListSnapshotsResponse>> {
        T::list_snapshots(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn create_snapshot(
        &self,
        req: crate::model::CreateSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Snapshot>> {
        T::create_snapshot(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn update_snapshot(
        &self,
        req: crate::model::UpdateSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Snapshot>> {
        T::update_snapshot(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn delete_snapshot(
        &self,
        req: crate::model::DeleteSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>> {
        T::delete_snapshot(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn seek(
        &self,
        req: crate::model::SeekRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::SeekResponse>> {
        T::seek(self, req, options).await
    }
}

/// A dyn-compatible, crate-private version of [super::SchemaService].
#[async_trait::async_trait]
pub trait SchemaService: std::fmt::Debug + Send + Sync {
    async fn create_schema(
        &self,
        req: crate::model::CreateSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Schema>>;

    async fn get_schema(
        &self,
        req: crate::model::GetSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Schema>>;

    async fn list_schemas(
        &self,
        req: crate::model::ListSchemasRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListSchemasResponse>>;

    async fn list_schema_revisions(
        &self,
        req: crate::model::ListSchemaRevisionsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListSchemaRevisionsResponse>>;

    async fn commit_schema(
        &self,
        req: crate::model::CommitSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Schema>>;

    async fn rollback_schema(
        &self,
        req: crate::model::RollbackSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Schema>>;

    async fn delete_schema_revision(
        &self,
        req: crate::model::DeleteSchemaRevisionRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Schema>>;

    async fn delete_schema(
        &self,
        req: crate::model::DeleteSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>>;

    async fn validate_schema(
        &self,
        req: crate::model::ValidateSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ValidateSchemaResponse>>;

    async fn validate_message(
        &self,
        req: crate::model::ValidateMessageRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ValidateMessageResponse>>;

    async fn set_iam_policy(
        &self,
        req: iam_v1::model::SetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<iam_v1::model::Policy>>;

    async fn get_iam_policy(
        &self,
        req: iam_v1::model::GetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<iam_v1::model::Policy>>;

    async fn test_iam_permissions(
        &self,
        req: iam_v1::model::TestIamPermissionsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>>;
}

/// All implementations of [super::SchemaService] also implement [SchemaService].
#[async_trait::async_trait]
impl<T: super::SchemaService> SchemaService for T {
    /// Forwards the call to the implementation provided by `T`.
    async fn create_schema(
        &self,
        req: crate::model::CreateSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Schema>> {
        T::create_schema(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_schema(
        &self,
        req: crate::model::GetSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Schema>> {
        T::get_schema(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_schemas(
        &self,
        req: crate::model::ListSchemasRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListSchemasResponse>> {
        T::list_schemas(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_schema_revisions(
        &self,
        req: crate::model::ListSchemaRevisionsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListSchemaRevisionsResponse>> {
        T::list_schema_revisions(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn commit_schema(
        &self,
        req: crate::model::CommitSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Schema>> {
        T::commit_schema(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn rollback_schema(
        &self,
        req: crate::model::RollbackSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Schema>> {
        T::rollback_schema(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn delete_schema_revision(
        &self,
        req: crate::model::DeleteSchemaRevisionRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Schema>> {
        T::delete_schema_revision(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn delete_schema(
        &self,
        req: crate::model::DeleteSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>> {
        T::delete_schema(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn validate_schema(
        &self,
        req: crate::model::ValidateSchemaRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ValidateSchemaResponse>> {
        T::validate_schema(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn validate_message(
        &self,
        req: crate::model::ValidateMessageRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ValidateMessageResponse>> {
        T::validate_message(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn set_iam_policy(
        &self,
        req: iam_v1::model::SetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<iam_v1::model::Policy>> {
        T::set_iam_policy(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_iam_policy(
        &self,
        req: iam_v1::model::GetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<iam_v1::model::Policy>> {
        T::get_iam_policy(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn test_iam_permissions(
        &self,
        req: iam_v1::model::TestIamPermissionsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>> {
        T::test_iam_permissions(self, req, options).await
    }
}
